#pragma once

#include "RHIBuffer.h"

class VertexBuffer : public RHIBuffer
{
	struct BuilderDetails
	{
		VkDeviceSize size;
		void* data;
		bool isRayUse;

		BuilderDetails()
		{
			size = 0;
			data = nullptr;
			isRayUse = false;
		}
	};

public:

	class Builder : public BuilderBase<BuilderDetails> {
		friend struct BuilderDetails;
	public:
		Builder() noexcept;
		Builder(Builder const& rhs) noexcept;
		Builder(Builder&& rhs) noexcept;
		~Builder() noexcept;
		Builder& operator=(Builder const& rhs) noexcept;
		Builder& operator=(Builder&& rhs) noexcept;

		Builder& SetData(void* data) noexcept;
		Builder& SetSize(VkDeviceSize size) noexcept;
		Builder& SetRayUse() noexcept;

		RefCountPtr<VertexBuffer> Build();
		RefCountPtr<VertexBuffer> Build(RenderProcess* process, const std::string& name);

	private:
		friend class VertexBuffer;
	};

	VertexBuffer(BuilderDetails& builderDetails);

	virtual void ReleaseResource() override;
};